

using System;
using System.Text;

using NHibernate;
using NHibernate.Cfg;
using NHibernate.Criterion;
using NHibernate.Exceptions;

using SpotifyGenNHibernate.EN.Spotify;
using SpotifyGenNHibernate.CAD.Spotify;

namespace SpotifyGenNHibernate.CEN.Spotify
{
        public partial class NoticiaCEN
        {
        private INoticiaCAD _INoticiaCAD;

        public NoticiaCEN(INoticiaCAD _INoticiaCAD)
        {
                this._INoticiaCAD = _INoticiaCAD;
        }

        public int New_ (String p_titulo, String p_descripcion, String p_enlace, Nullable<DateTime> p_fechaPublicacion)
        {
                NoticiaEN noticiaEN = null;
                int oid;

                //Initialized NoticiaEN
                noticiaEN = new NoticiaEN ();
                noticiaEN.Titulo = p_titulo;
                noticiaEN.Descripcion = p_descripcion;
                noticiaEN.Enlace = p_enlace;
                noticiaEN.FechaPublicacion = p_fechaPublicacion;
                //Call to NoticiaCAD

                oid = _INoticiaCAD.New_ (noticiaEN);
                return oid;
        }

        public void Destroy (int id)
        {
                _INoticiaCAD.Destroy (
                        id

                        );
        }

        public void Edit (int p_Noticia_OID, String p_titulo, String p_descripcion, String p_enlace, Nullable<DateTime> p_fechaPublicacion)
        {
                NoticiaEN noticiaEN = null;

                //Initialized NoticiaEN
                noticiaEN = new NoticiaEN ();
                noticiaEN.Id = p_Noticia_OID;
                noticiaEN.Titulo = p_titulo;
                noticiaEN.Descripcion = p_descripcion;
                noticiaEN.Enlace = p_enlace;
                noticiaEN.FechaPublicacion = p_fechaPublicacion;
                //Call to NoticiaCAD

                _INoticiaCAD.Edit (noticiaEN);
        }

        public System.Collections.Generic.IList<NoticiaEN> Consultar (int first, int size)
        {
                System.Collections.Generic.IList<NoticiaEN> list = null;

                list = _INoticiaCAD.Consultar (first, size);
                return list;
        }
        }
}
